package com.dnjn.happiness.emo.api;

import com.dnjn.happiness.common.core.constant.SecurityConstants;
import com.dnjn.happiness.common.core.constant.ServiceNameConstants;
import com.dnjn.happiness.common.core.domain.R;
import com.dnjn.happiness.common.core.model.HxBeanSeed;
import com.dnjn.happiness.emo.api.factory.RemoteEmoUserFallbackFactory;
import com.dnjn.happiness.emo.api.model.EmoUserBean;
import com.dnjn.happiness.emo.api.model.EmoUserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(contextId = "remoteEmoUserService",value = ServiceNameConstants.EMO_SERVICE,fallbackFactory = RemoteEmoUserFallbackFactory.class)
public interface RemoteEmoUserService {

    @GetMapping("/user/updateHappinessScoreByUserId/{userId}/{hscore}")
    void updateHappinessScoreByUserId(@PathVariable("userId") Long userId, @PathVariable("hscore") Integer hscore,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    @GetMapping("/user/updateWorkDate/{userId}")
    public R<Boolean> updateWorkDate(@PathVariable("userId") Long userId,@RequestHeader(SecurityConstants.FROM_SOURCE) String source) ;


    @GetMapping("/user/selectByLimit/{index}/{num}")
    public R<List<EmoUserBean> > selectByLimit(@PathVariable("index") int index, @PathVariable("num") int num,@RequestHeader(SecurityConstants.FROM_SOURCE) String source) ;

    /**
     *
     */
    @PostMapping("/user/getCount")
    public R<Long> getCount(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    /**
     *
     */
    @PostMapping("/user/saveEmoUser")
    public R<EmoUserVO> saveEmoUser(@RequestBody HxBeanSeed beanSeed, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    /**
     *
     */
    @PostMapping("/user/delEmoUser")
    public void delEmoUser(@RequestBody HxBeanSeed beanSeed, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/user/updateHBean")
    public R<Boolean> updateHBean(@RequestBody HxBeanSeed beanSeed, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/user/getInfoByUserId/{userId}")
    public R<EmoUserVO> getInfoByUserId(@PathVariable("userId") Long userId,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/user/updateHappinessScores/{userId}/{happinessScores}")
    public R<Boolean> updateHappinessScores(@PathVariable("userId") Long userId, @PathVariable("happinessScores") Integer happinessScores,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/user/saveEmoUserById/{userId}")
    public R<EmoUserVO> saveEmoUserById(@PathVariable("userId") Long userId,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/user/selectUserList")
    public R<List<EmoUserVO>> selectUserList(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/user/emptytheHappyBeansToday")
    public void emptytheHappyBeansToday(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
;

}
